import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';

import {Observable} from "rxjs/Observable";
import 'rxjs/add/operator/map';


@Injectable()
export class HistoricalPerformanceProvider {

    constructor(public http: HttpClient) {
    }

    data = [
        // {
        //     'chargeName': '中国人',
        //     'chargeLevel': 'SMD',
        //     'yearPc': '150000000.11',
        //     'topPc': '170000022.33',
        //     'pcGap': '100112000.33',//净pc差距
        //     'yearLifeInsurance': '200000000.12',
        //     'topLifeInsurance': '880011111.88',
        //     'lifeInsGap': '300111110.08'
        // },
        {
            'chargeName': '中国人中国人',
            'chargeLevel': 'SMD',
            'yearPc': '0',
            'topPc': '0',
            'pcGap': '0',//净pc差距
            'yearLifeInsurance': '0',
            'topLifeInsurance': '0',
            'lifeInsGap': '0'
        },
        {
            'chargeName': '中国人中国人',
            'chargeLevel': 'SMD',
            'yearPc': '150000000',
            'topPc': '170000570',
            'pcGap': '450770456',//净pc差距
            'yearLifeInsurance': '200000000',
            'topLifeInsurance': '800888777',
            'lifeInsGap': '300777000'
        },
        {
            'chargeName': '中国人传的',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '451145',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
        {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
        {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        }, {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        }, {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
        {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
        {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        }, {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
        {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        }, {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        }, {
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
    ];

    data1 = [
        {
            'groupType':'0',
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
        {
            'groupType':'0',
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
        {
            'groupType':'1',
            'chargeName': 'zhuguan01',
            'chargeLevel': 'SMD',
            'yearPc': '15000',
            'topPc': '17000',
            'pcGap': '4545',//净pc差距
            'yearLifeInsurance': '200000',
            'topLifeInsurance': '8888',
            'lifeInsGap': '3000'
        },
    ];

    /**
     * 获取团队历史业绩
     * @param  id
     * @returns {Observable<any>}
     */
    getHistoricalPer(id?:any): Observable<any> {

            // return Observable.create(o => {
            //     o.next(this.data1);
            // })
          return this.http.get(`/achieve/v1/groupAllTeamHistoryAchieve?groupType=${id?id:''}`);

    }
}
